import type { App, VNode } from "vue"
import Loading from './Loading.vue'
import { createVNode, render } from "vue"

export default {
  install(app: App) {
    const Vnode: VNode = createVNode(Loading)
    render(Vnode, document.body) // 挂载到 body
    app.config.globalProperties._loading = {
      showLoading: Vnode.component?.exposed?.showLoading,
      hideLoading: Vnode.component?.exposed?.hideLoading
    }
  }
}